import { FilterRoutes } from './hook-types'

export const filterRoutes: FilterRoutes = routes => {
  return routes.filter(item => {
    if (item.meta?.hidden === true) {
      return false
    } else {
      if (item.children && item.children.length) {
        filterRoutes(item.children)
      }
      return true
    }
  })
}
